class Solution {
public:
    int hammingWeight(uint32_t n) {
         uint32_t a=1,cnt=0;
        while(a!=0)
        {
            if(a&n)
            {
                cnt++;
            }
            a=a<<1;
        }
        return cnt;
    }
};